<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<style>
		* {
			padding: 0px;
			margin: 0px;
		}
		body {
			display: flex;
			align-items: center;
			align-content: center;
			justify-content: space-around;
			margin-top: 40px;
		}
		.container {
			width: 660px;
			height: 940px;
			border: 1px solid black;
			/* transform: translate(-50%); */
		}
		.container .anniu {
			width: 270px;
			height: 400px;
			border: 1px solid red;
			margin-left: 10px;
			margin-top: 10px;
			overflow: hidden;
		}

		.anniu .tr1 {
			width: 540px;
		}

		.container .dengpao {
			width: 240px;
			height: 260px;
			border: 1px solid green;
			margin: 30px auto;
			overflow: hidden;
		}

		.dengpao .tr2 {
			width: 520px;
		}

		.container .anniu .tr1:hover {
			transform: translate(-50%);
		}
		/* ~表示的是兄弟 */
		.container .anniu:hover ~ .dengpao .tr2 {
			transform: translate(-50%);
		}
	</style>
	<body>
		<div>使用transfrom的平移，溢出的边框隐藏</div>
		<div class="container">
			<div class="anniu">
				<img src="./light-switch.png" alt="" class="tr1" />
			</div>

			<div class="dengpao">
				<img src="./lightbulb.png" alt="" class="tr2" />
			</div>
		</div>
	</body>
</html>
